package com.kly.manager.websocket.enums;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;

/**
 * @author admin
 * @date 2025/3/21
 */
@Getter
public enum PictureEditActionEnum {
    // 放大，缩小，左旋，右旋
    ZOOM_IN("放大", "ZOOM_IN"),
    ZOOM_OUT("缩小", "ZOOM_OUT"),
    ROTATE_LEFT("左旋", "ROTATE_LEFT"),
    ROTATE_RIGHT("右旋", "ROTATE_RIGHT"),
    ;
    private final String text;
    private final String value;

    PictureEditActionEnum(String text, String value) {
        this.text = text;
        this.value = value;
    }

    /**
     * 获取对应枚举值
     */
    public static PictureEditActionEnum getEditActionEnumByValue(String text) {
        if(StrUtil.isBlank(text)) {
            return null;
        }
        for (PictureEditActionEnum value : PictureEditActionEnum.values()) {
            if(value.getValue().equals(text)) {
                return value;
            }
        }
        return null;
    }
}
